﻿@model Personalblog.Model.Entitys.Tag

@{
    var rnd = Random.Shared;
    var colorList = new[]
    {
        "text-bg-primary ",
        "text-bg-secondary",
        "text-bg-danger",
        "text-bg-warning",
        "text-bg-info",
        "text-bg-light",
        "text-bg-dark ",
    };
    var btnColor = colorList[rnd.Next(0, colorList.Length)];
}
<div class="Tag-btn box">
    <a style="display: contents" href="@Url.Action("Index", new { tagId = Model.Id })">
        <button type="button" class="btn @btnColor">
            <i class="bi bi-tags"></i>
            @Model.Name
        </button>
    </a>
</div>